/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package assignment2;

import java.util.ArrayList;

/**
 * InventoryList Class:
 * This class is separate from the Inventory class, but enables the Inventory and List of Inventory available to be modified
 * @author Vale
 *
 */
public class InventoryList {

    private ArrayList<Inventory> inventList = new ArrayList<Inventory>();

    /**
     * void add(Inventory inv) Method:
     * Adds an Inventory Item (inv) to the Inventory List
     *
     */
    public void add(Inventory inv) {
        inventList.add(inv);
    }

    /**
     * void remove(int index) Method:
     * Removes Inventory Item at index, from the Inventory List
     *
     */
    public void remove(int index) {
        inventList.remove(index);
    }

    /**
     * void remove(Inventory inv) Method:
     * Removes given Inventory Item (inv) from the Inventory List
     *
     */
    public void remove(Inventory inv) {
        inventList.remove(inv);
    }

    /**
     * boolean isEmpty() Method:
     * Checks if Inventory List is empty
     * @return True if empty, false otherwise
     *
     */
    public boolean isEmpty() {
        return inventList.isEmpty();
    }

    /**
     * int indexOf(Inventory inv) Method:
     * Returns index of given Inventory ITem
     * @param inv The Inventory Item whose index is sought
     * @return Returns index of given Inventory ITem
     *
     */
    public int indexOf(Inventory inv) {
        return inventList.indexOf(inv);
    }

    /**
     * int size() Method:
     * Returns Size of Inventory List
     * @return Returns Size of Inventory List
     *
     */
    public int size() {
        return inventList.size();
    }

    /**
     * Product get(int index) Method:
     * Returns Inventory Item from Inventory List at given index
     * @param index The index of the Inventory Item
     * @return Returns Inventory Item from Inventory List at given index
     *
     */
    public Inventory get(int index) {
        return inventList.get(index);
    }

    /**
     * ArrayList<Inventory> getInvList() Method:
     * Returns List of Inventory Items
     * @return Returns List of Inventory Items
     *
     */
    public ArrayList<Inventory> getInvList() {
        return inventList;
    }

    /**
     * InventoryList getInvListObject() Method:
     * Returns List of Inventory Items
     * @return Returns List of Inventory Items
     *
     */
    public InventoryList getInvListObject() {
        return this;
    }

    /**
     * boolean contains(Inventory inv) Method:
     * Used to determine if an inventory item exists within the inventory list
     * @return Returns boolean true if the item exists, false otherwise
     *
     */
    public boolean contains(Inventory inv) {
        return inventList.contains(inv);
    }
}
